Fix handling of style property in Tabs component#139
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
=======================================
Coverage 92.21% 92.22%
=======================================
Files 86 86
Lines 1503 1504 +1
Branches 231 230 -1
=======================================
+ Hits 1386 1387 +1
Misses 98 98
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b-yogesh
left a comment
There was a problem hiding this comment.
Thanks. Looks good. Please have a look at my comments.
| type: "Tab"; | ||
| label?: string; | ||
| icon?: string; | ||
| iconPosition?: "bottom" | "end" | "start" | "top" | undefined; |
There was a problem hiding this comment.
why do we have undefined here?
Also, in the API docs https://mui.com/material-ui/api/tab/, the default is set to top. If you change that to undefined, does it affect it in any way?
There was a problem hiding this comment.
You're right, undefined shouldn't be here. I removed it.
| return ( | ||
| <MuiTab | ||
| key={index} | ||
| style={tabState?.style} |
There was a problem hiding this comment.
we apply the same style to both the Tab button and body, was this a design decision? or does it needs discussion?
There was a problem hiding this comment.
Correct, this enables a user to apply styling to the entire Tab component (Button in the header + body).
Before this change it was only possible to change the styling of the button and the user had no styling control over the content (body) of the Tab (see #135).
However, this desicion was not discussed.
This PR:
styleprop inTabscomponent.iconPositiontoTabscomponentExample Panel H (chartlets.py/demo/my_extension/my_panel_8.py):
Closes #135 and #136.